#import <Foundation/Foundation.h>
#import "Atom.h"
#import "Person.h"
#import "Mouse.h"
#import "Tree.h"
#import "flower.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        Person *p = [[Person alloc] init];
        p.name = @"人类";
        
        Mouse *m = [[Mouse alloc] init];
        m.name = @"米老鼠";
        
        Tree *s = [[Tree alloc] init];
        p.name = @"大树";
        
        flower *f = [[flower alloc] init];
        m.name = @"花朵";
        
        NSArray *arr = @[p, m,s,f,];
        for (int i = 0; i < arr.count; i++) {
            Animal *ani = arr[i];
            Tree *an = arr[i＋1];
            [ani eat];
            [ani sleep];
            [an photosynthesis];
            [an respiration];
        }
        


    }
    return 0;
}

